package dto

import (
	"gitee.com/zhoulvvv/my_go_gateway/public"
	"github.com/gin-gonic/gin"
)

type TokensInput struct {
	GrantType string `json:"grant_type" form:"grant_type" comment:"授权类型" example:"client_credentials" validate:"required"`
	Scope     string `json:"scope" form:"scope" comment:"权限范围" example:"read_write" validate:"required"`
}

type TokensOutput struct {
	AccessToken string `json:"access_token" form:"access_token" comment:"access_token"`
	ExpiresIn   int    `json:"expires_in" form:"expires_in" comment:"超时时间"`
	TokenType   string `json:"token_type" form:"token_type" comment:"token类型"`
	Scope       string `json:"scope" form:"scope" comment:"token权限范围"`
}

func (param *TokensInput) BindValidaParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, param)
}
